<script>
import Aside from "@/components/Aside.vue";
import Header from "@/components/Header.vue";


export default {
  components: {Header, Aside},
  data() {
    return {
      isCollapse:false,
      aside_width:'200px',
      icon:'el-icon-s-fold'
    }
  },
  methods:{
    collapse() {
      // console.log('collapse');
      this.isCollapse = !this.isCollapse;
      if(this.isCollapse){
        this.aside_width='64px'
        this.icon = 'el-icon-s-fold'
      }else{
        this.aside_width='200px'
        this.icon = 'el-icon-s-unfold'
      }
    }
  }
}
</script>

<template>
  <el-container style="height: 100%; border: 1px solid #eee">
    <el-aside :width="aside_width" style="background-color: rgb(238, 241, 246);height: 100vh">
      <Aside :isCollapse="isCollapse"></Aside>
    </el-aside>

    <el-container style="height: 100%">
      <el-header style="height: 100%;text-align: right; font-size: 12px;border-bottom: darkgray 1px solid">
       <Header @collapse="collapse" :icon="icon"></Header>
      </el-header>

      <el-main style="height: 100%">
<!--        <Main></Main>-->
        <router-view></router-view>
      </el-main>
    </el-container>
  </el-container>
</template>

<style scoped>
.el-header {
  //background-color: #B3C0D1;
  color: #333;
  line-height: 60px;
}

.el-aside {
  color: #333;
}
</style>